package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseParam;
import com.cskaoyan.bean.BaseRespData;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.service.GoodsService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/goods")
public class GoodsController {

    @Autowired
    GoodsService goodsService;

    /**
     * goodsSn:
     * name: 苹果
     */
    @RequiresPermissions("see")
    @RequestMapping("/list")
    public BaseRespVo list(String goodsSn, String name, BaseParam baseParam) {
        BaseRespData data = goodsService.query(goodsSn, name, baseParam);
        return BaseRespVo.ok(data);
    }
}
